﻿var Service = {
	
	urlService : {
		getUrl:function() {
			var _url;
			ajaxProcess({
	            url : '/pls/gis/enterprise/queryPropByKey',
	            requestType : 'POST',
	            async:false,
	            data : {key: 'WebReportUrl'},
	            successHandle : function(data) {
	            	_url = data.data;
	            }
	        });
			return _url;
		}
	},	
		
	areaService: {
		getAreas:function() {
			ajaxProcess({
	            url : '/pls/gis/areaCode/list',
	            requestType : 'POST',
	            async:false,
	            data : {},
	            successHandle : function(data) {
	            	AreaLevelController.render(data.data);
	            }
	        });
		}
	},
	
	tradeService: {
		
		getTrades:function() {
			ajaxProcess({
	            url : '/pls/gis/tradeCode/list',
	            requestType : 'POST',
	            async:false,
	            data : {},
	            successHandle : function(data) {
	            	TradeLevelController.render(data.rows);
	            }
	        });
		}
	},
	
	controlLevelService: {
		
		getControleLevels:function(){
			ajaxProcess({
	            url : '/pls/gis/general/list',
	            requestType : 'POST',
	            async:false,
	            data : {},
	            successHandle : function(data) {
	            	ControlLevelController.render(data.rows);
	            }
	        });
		}
	},
	
	polluteService: {
		
		getPollutes:function(){
			ajaxProcess({
	            url : '/pls/gis/stdpoll/list',
	            requestType : 'POST',
	            async:false,
	            data : {},
	            successHandle : function(data) {
	            	
	            	AdvancedController.renderPolluteList(data.rows);
	            	permitActualController.render(data.rows);
	            }
	        });
		}
	},
	
	timeService: {
		
		getYears: function(){
			AdvancedController.renderYearList(5);
		}
	},
	
	processTechService: {
		
		getProcessTech:function(){
			ajaxProcess({
	            url : '/pls/gis/technics/list',
	            requestType : 'POST',
	            async:false,
	            data : {},
	            successHandle : function(data) {
	            	//console.log(data);
	            	AdvancedController.renderProcessTech(data.rows);
	            }
	        });
		}
	},
	
	enterpriseService: {
		
		getEnterprisesBySearch:function(callback){
			var $keywords = $('#sole-input');
			var keywords = $keywords.val();
			if(keywords=='排污许可企业'){
				keywords = '';
			}
			ajaxProcess({
	            url : '/pls/gis/enterprise/queryCompatys',
	            requestType : 'POST',
	            async:false,
	            data : {pn: 1, amount:20, companyName: keywords},
	            successHandle : function(data) {
	            	if(callback && typeof callback==='function') {
	            		callback(data.data.list);
	            	}
	            }
	        });
		}
	},
	
	pollutePointService:{
		
		getPointType:function(){},
		
		getGasAndWaterPointCount:function(){},
		
		getPointsBySearch:function(){},
		
		//分废气、废水
		getPointsCountByArea:function(){},
		
		getPointsCountByTrade:function(){},
		
		getPointsCountByControlLevel:function(){},
		
		getPointInfoByCode: function(code){},
		
		getPointPolluteStandByCode: function(code){},
		
		getPointRealTimeDataByCode: function(code){}
	},
	
	emissionService: {
		
		getCityAggregationEmission:function(){},
		
		getAreaAggregationEmission:function(){},
		
		getEnterpriseEmission:function(){},
		
		getEmissionByArea: function(){},
		
		getEmissionByTrade: function(){},
		
		getEmissionByControl: function(){},
		
		getEmissionRankByCity:function(){},
		
		getEmissionRankByArea: function(){},
		
		getEmissionRankByEnterprise: function(){}
	},
	
	licenseExpireWarmService: {
		
		getExpireCountByDuaration: function() {},
		
		getCityAggregationExpireCount:function(){},
		
		getAreaAggregationExpireCount:function(){},
		
		getEnterpriseExpire:function(){}
	},
	
	illegalEnterpriseService: {
		
		getCityAggregationIllegalCount:function(){},
		
		getAreaAggregationIllegalCount:function(){},
		
		getEnterpriseIllegalCount:function(){},
		
		getEnterpriseIllegalList:function(){}
	},
	
	environmentSerivce: {

		getCityAggregationPermitPollute:function(){},
		
		getAreaAggregationPermitPollute:function(){},
		
		getEnterprisePermitPollute:function(){},
		
		getCityAggregationActualPollute:function(){},
		
		getAreaAggregationActualPollute:function(){},
		
		getEnterpriseActualPollute:function(){},
		
		//aqi浓度分布
		getAirDistributeByIndex: function(){},
		
		getCityAirRankByIndex:function(){},
		
		getAreaAirRankByIndex:function(){},
		
		getPointAirRankByIndex:function(){}
	}
};